package com.sz.sidi.oa.ui.login;

import org.eclipse.jface.action.StatusLineContributionItem;
import org.eclipse.jface.action.StatusLineLayoutData;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.wb.swt.ResourceManager;

import util.Session;

public class AbstractContributionItem extends StatusLineContributionItem{

	/**
	 * @wbp.parser.entryPoint
	 */
	public AbstractContributionItem(String id) {
		super(id);
		 
	}
	
	/**
	 * @wbp.parser.entryPoint
	 */
	@Override
	public void fill(Composite parent) {
		CLabel labelleft = new CLabel(parent, SWT.SHADOW_OUT | SWT.SHADOW_NONE | SWT.LEFT);
		 StatusLineLayoutData layout = new StatusLineLayoutData();
		 Rectangle screenSize = Display.getDefault().getClientArea();
		 layout.widthHint = screenSize.width + 1500;
		 
		 labelleft.setLayoutData(layout);
		 labelleft.setImage(ResourceManager.getPluginImage("com.sz.sidi.oa", "icons/chart_16.png"));
		  String username = Session.getUserinfo().getFusername() + "      127.0.0.1";
		  labelleft.setText(username);
	}
	
}
